package com.situ.ssm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.ssm.entity.Course;
import com.situ.ssm.service.ICourseService;
import com.situ.ssm.vo.PageBean;
import com.situ.ssm.vo.CourseSearchCondition;

@Controller
@RequestMapping("/course")
public class CourseController {
	private Integer age;
	
	@Autowired
	private ICourseService courseService;
	
	@RequestMapping("/pageList")
	@ResponseBody
	public PageBean<Course> pageList(CourseSearchCondition condition) {
		return courseService.getPageBean(condition);
	}
	
	
	@RequestMapping(value="/list")
	@ResponseBody
	public List<Course> list() {
		return courseService.list();
	}
	
	@RequestMapping("/insert")
	@ResponseBody
	public boolean insert(Course course) {
		return courseService.insert(course);
	}
}
